from typing import Any, Union

from core.tools.entities.tool_entities import ToolInvokeMessage
from core.tools.tool.builtin_tool import BuiltinTool


class BrainElectrodeTool(BuiltinTool):
    def _invoke(
        self,
        user_id: str,
        tool_parameters: dict[str, Any],
    ) -> Union[ToolInvokeMessage, list[ToolInvokeMessage]]:
        """
        invoke tools
        """

        result = []

        # # for image in response.data:
        # _, buffer = cv2.imencode(".jpg", frame)
        # result.append(
        #         self.create_blob_message(
        #             blob=buffer.tobytes(),
        #             meta={"mime_type": "image/png"},
        #         save_as=self.VariableKey.IMAGE.value,
        #     )
        # )
        
        return result
